package com.basic;

import com.frame.struts.BaseBean;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;
import com.utils.*;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class StructDetailForm extends BaseBean {
    public StructDetailForm() {
    }
	StructDetailEntity ae = new StructDetailEntity();
	public String addStructDetail(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		ae.setQyid(qyid);
		System.out.println("1222111");
		try{
		if(factory.addStructDetail(ae)){
			    response.sendRedirect("/basic/modifyStructDetail.jsp");
				return "success";
		}
		response.sendRedirect("/basic/failed.jsp");
		}
		catch (Exception e) {

		}

			return "failed";

	}
	public String modifyStructDetail(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		ae.setQyid(qyid);
		//factory.deleteAssociationAgent(qyid);
		System.out.println("111111");
		try{
			if(factory.addStructDetail(ae)){
			    response.sendRedirect("/basic/modifyStructDetail.jsp");
				return "success";
		}
		response.sendRedirect("/basic/failed.jsp");
		}
		catch (Exception e) {

		}

		return "failed";

	}


	public void setYclscqkmsx(String yclscqkmsx){
		ae.setYclscqkmsx(yclscqkmsx);
	}
	public String getYclscqkmsx(){
		return ae.getYclscqkmsx();
	}
	public void setQyid(String qyid){
		ae.setQyid(qyid);
	}
	public String getQyid(){
		return ae.getQyid();
	}

}